<?php

namespace App\Exceptions;

use Exception;

class BaseException extends Exception
{

    /**
     * 错误码前缀
     * 子类继承需复写
     *
     * @var int
     */
    protected $code_prefix = 100;

    /**
     * ApiTokenException constructor.
     * @param $message
     * @param $code
     */
    public function __construct($message, $code)
    {
        $code = $this->code_prefix . $code;
        parent::__construct($message, intval($code));
    }

}
